package componentes;

import java.util.List;

import javax.faces.component.UIOutput;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;

public class UIStrategyMap extends UIOutput {
	
	private String perspectives;

	public Object saveState(FacesContext fc){
		Object[] values = new Object[2];
		
		values[0] = super.saveState(fc);
		values[1] = getPerspectives();
		
		return (Object)values;
	}

	@SuppressWarnings("unchecked")
	public void restoreState(FacesContext facesContext, Object state) {
		Object[] values = (Object[])state;
		super.restoreState(facesContext, values[0]);
		setPerspectives((String) values[1]);		
	}
	
	public String getFamily(){
		return COMPONENT_FAMILY;
	}

	public void setPerspectives(String perspectives) {
		this.perspectives = perspectives;
	}

	public String getPerspectives() {
		ValueBinding _vb = getValueBinding(perspectives);
		if (_vb != null){
			return (String) _vb.getValue(getFacesContext());
		}
		else{
			return perspectives;
		}
	}
}
